package com.lightjet.macross.base.upms.repository;

import com.lightjet.macross.base.upms.domain.AppClient;
import com.lightjet.macross.common.core.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("appClientRepository")
public interface AppClientRepository extends BaseRepository<AppClient, Integer> {

    AppClient findByClientid(String clientid);

    AppClient findByClientname(String clientname);

    @Query("select t from AppClient t where coalesce(t.clientname,'!@#') like :keywords or coalesce(t.description,'!@#') like :keywords")
    List<AppClient> findByKeywords(@Param("keywords") String keywords);

    AppClient findDistinctById(Integer id);
}
